//
//  UIButton+Extension.swift
//  WeiboSwift
//
//  Created by LYFDevelopment on 2017/4/13.
//  Copyright © 2017年 LYFDevelopment. All rights reserved.
//

import Foundation
import UIKit

extension UIButton{
    convenience init (backGrundImage:UIImage?, image:UIImage?) {
        
        self.init(type: UIButtonType.custom)
        setBackgroundImage(backGrundImage, for: .normal)
        setImage(image, for: .normal)
    }
    convenience init(title:String?,fontSize:CGFloat?, normalColor:UIColor? = UIColor.blue, highlightedColor: UIColor? = UIColor.orange){

        self.init()
        setTitle(title!, for: .normal)
        self.titleLabel?.font = UIFont.systemFont(ofSize: fontSize!)
        self.setTitleColor(normalColor, for: .normal)
        self.setTitleColor(highlightedColor, for: .highlighted)
        sizeToFit()
    }
    
}
